import request from '../utils/request.js'

export const getcode = (id) => {
  return request({
    method: 'get',
    url: `/getVerCode?phone=${id}`
  })
}
export const namelogin = (id, code) => {
  return request({
    method: 'get',
    url: `/login?phone=${id}&verCode=${code}`
  })
}
export const getimg = (userId, content) => {
  console.log(userId, content)
  return request({
    method: 'post',
    url: '/uploadAvatar',
    data: {
      userId,
      content
    }
  })
}
export const getusename = (userId, name) => {
  console.log(userId, name)
  return request({
    method: 'post',
    url: '/uploadName',
    data: {
      userId,
      name
    }
  })
}
export const getsex = (gender, userId) => {
  console.log(userId, gender)
  return request({
    method: 'post',
    url: '/uploadGender',
    data: {
      gender,
      userId
    }
  })
}
export const getage = (birth, userId) => {
  console.log(userId, birth)
  return request({
    method: 'post',
    url: '/uploadBirth',
    data: {
      birth,
      userId
    }
  })
}
